1375d01bdf7c56577aa23b346c8e06ed474ca5b1,router/java/src/net/i2p/router/transport/BandwidthLimitedInputStream.java,BandwidthLimitedInputStream,skip,#number#,65
Before Change
public long skip(long numBytes) throws IOException {
long skip = in.skip(numBytes);
if (_pullFromOutbound)
_context.bandwidthLimiter().requestOutbound((int)skip, _peerSource);
else
_context.bandwidthLimiter().requestInbound((int)skip, _peerSource);
return skip;
After Change
long skip = in.skip(numBytes);
FIFOBandwidthLimiter.Request req = null;
if (_pullFromOutbound)
req = _context.bandwidthLimiter().requestOutbound((int)skip, _peerSource);
else
req = _context.bandwidthLimiter().requestInbound((int)skip, _peerSource);
while ( (req.getPendingInboundRequested() > 0) ||
(req.getPendingOutboundRequested() > 0) ) {
// we still haven't been authorized for everything, keep on waiting
req.waitForNextAllocation();
}